
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:xim/common/get_style_view.dart';
import 'package:xim/widget/common/state.dart';

class LoginPageStyle extends Style with AppBarMixin {

  @override
  Color get appBarBgColor => Colors.transparent;

  Widget get logo =>  SizedBox(
    height: 0.6.sh,
    child: Center(
      child: Image.asset( 'assets/image/logo.png',),
    ),
  );


  Widget loginBox(){
    return   Container(
      width: 0.6.sw,
      padding: const EdgeInsets.symmetric(vertical: 12),
      decoration:  BoxDecoration(
          borderRadius: const BorderRadius.all(Radius.circular(20)),
          border: Border.all(color: Colors.grey)
      ),
      child:  Center(
        child: InkWell(
          // onTap: ()=> context.go("/login/pwd"),
          child: const Text("登录已有账号", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Colors.blueAccent), ),
        ),
      ),
    );
  }


  Widget createAccountBox(){
    return Container(
      width: 0.6.sw,
      padding: const EdgeInsets.symmetric(vertical: 12),
      decoration: const BoxDecoration(
          borderRadius: BorderRadius.all(Radius.circular(20)),
          gradient: LinearGradient(
              begin: Alignment.centerLeft,
              end: AlignmentDirectional.centerEnd,
              colors: [Color(0xff04ffef), Color(0xff0b6cfe)]
          )
      ),
      child: InkWell(
        child: const Center(
          child: Text("生成一个账号", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Colors.white), ),
        ),
        onTap: () async {
          // aa
          EasyLoading.instance.indicatorType = EasyLoadingIndicatorType.wanderingCubes;
          EasyLoading.show(status: 'loading...');
          // if(await UserApi.requestToken()){
          //   Navigator.of(context).pushReplacement(MaterialPageRoute(
          //       builder: (BuildContext context){
          //         return const MainScreen();
          //       })
          //   );
          // }
          EasyLoading.dismiss();
          // 创建账号
        },
      ),
    );
  }



}